/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.jfonia.connect5.intervals;

import org.jfonia.connect5.basics.BasicValueNode;
import org.jfonia.connect5.basics.BasicNode;
import org.jfonia.connect5.basics.MutableValueNode;
import org.jfonia.connect5.numerical.LongSumRelation;

/**
 *
 * @author installer
 */
public class BasicLongInterval extends BasicNode implements Interval<Long>
{
	protected MutableValueNode<Long> begin;
	protected MutableValueNode<Long> end;
	protected MutableValueNode<Long> difference;

	public BasicLongInterval()
	{
		begin = new BasicValueNode<Long>(0l);
		end = new BasicValueNode<Long>(0l);
		difference = new BasicValueNode<Long>(0l);

		new LongSumRelation(begin, difference, end);
	}

	public Long getBegin()
	{
		return begin.getValue();
	}

	public BasicLongInterval setBegin(long value)
	{
		begin.setValue(value);
		return this;
	}

	public Long getEnd()
	{
		return end.getValue();
	}

	public BasicLongInterval setEnd(long value)
	{
		end.setValue(value);
		return this;
	}

	public Long getDifference()
	{
		return difference.getValue();
	}

	public BasicLongInterval setDifference(Long value)
	{
		difference.setValue(value);
		return this;
	}

	public MutableValueNode<Long> getBeginNode()
	{
		return begin;
	}

	public MutableValueNode<Long> getEndNode()
	{
		return end;
	}

	public MutableValueNode<Long> getDifferenceNode()
	{
		return difference;
	}
}
